package com.beverages.messages.client;

import com.beverages.messages.common.Result;
import com.beverages.messages.config.FeignOkHttpConfig;
import com.beverages.messages.entity.dto.intermediate.OrdersDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient(name = "customer-orders-service", url = "${customer.orders.service.url}", configuration = FeignOkHttpConfig.class)
public interface CustomerOrdersClient {

    @GetMapping("/customer/orders/{orderId}")
    Result<OrdersDTO> findOne(@PathVariable("orderId") Integer orderId);

    @GetMapping("/customer/orders/orderNumber/{orderNumber}")
    Result<OrdersDTO> findOneByOrderNumber(@PathVariable("orderNumber") String orderNumber);
}
